#!/bin/bash
sudo -u ec2-user -i <<'EOF'

cd ~

aws s3 cp s3://sagemaker-cn-north-1-338598867091/autogluon.zip ~/anaconda3/envs/

cd ~/anaconda3/envs/

unzip autogluon.zip

source activate autogluon

source deactivate

aws s3 cp s3://sagemaker-cn-north-1-338598867091/resnet50_v1b-0ecdba34.zip ~/.mxnet/models/
aws s3 cp s3://sagemaker-cn-north-1-338598867091/resnet18_v1b-2d9d980c.zip ~/.mxnet/models/
aws s3 cp s3://sagemaker-cn-north-1-338598867091/yolo3_mobilenet1.0_coco-66dbbae6.zip ~/.mxnet/models/
aws s3 cp s3://sagemaker-cn-north-1-338598867091/resnet34_v1b-8e16b848.zip ~/.mxnet/models/

cd ~/.mxnet/models/

unzip resnet50_v1b-0ecdba34.zip
unzip resnet18_v1b-2d9d980c.zip
unzip yolo3_mobilenet1.0_coco-66dbbae6.zip
unzip resnet34_v1b-8e16b848.zip

cd ~/SageMaker/GTC2020-AutoGluonCV/
aws s3 cp s3://sagemaker-cn-north-1-338598867091/shopee-iet.zip .
aws s3 cp s3://sagemaker-cn-north-1-338598867091/tiny_motorbike.zip .

EOF
